<?php
$id = $_REQUEST["id"];
$page = $_REQUEST["page"];
include("include/db_connect.php");

$selectQuery = mysql_query("Select State from dc_user where UID = '".$id."'");
$result = mysql_fetch_array($selectQuery);

if($result[0]==2) $state = 0;
else $state = 2;

mysql_query("Update dc_user Set State='".$state."' Where UID='".$id."'");
header("Location:userList.php?page=$page");
?>
